package com.bcbim.model_server_interface.component.vo;

import com.bcbim.model_server_interface.component.bo.ComponentCenterBO;
import lombok.Data;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * @Description: 构件中心点
 * @Author: ye
 * @Date: 2022/5/13
 * @Version: V1.0
 **/
@Data
public class ComponentCenterVO implements Serializable {
    private String id;
    private XYZ center;

    public ComponentCenterVO() {
    }

    public ComponentCenterVO(ComponentCenterBO component) {
        if (component == null) {
            return;
        }
        if (StringUtils.isNotEmpty(component.getId())) {
            this.id = component.getId();
        }
        if (ObjectUtils.isNotEmpty(component.getX())
                || ObjectUtils.isNotEmpty(component.getY())
                || ObjectUtils.isNotEmpty(component.getZ())) {
            center = new XYZ(component.getX(),component.getY(),component.getZ());
        }
    }

}


